public class Problem3 {

    public static void main(String[] args) {
	double myNnumber = 600851475143.;
	float max = 0;
	for (float i = 1; i < 10000; i++) {
	    if (max != 0)
		break;
	    int counter = 0;
	    for (int j = 1; j <= i; j++) {
		if (i % j == 0) {
		    counter++;
		}
		if (counter == 2) {
		    while (myNnumber != 1 && myNnumber % i == 0) {
			max = 0;
			myNnumber = myNnumber / i;
		    }
		    if (myNnumber == 1.0) {
			max = i;
			break;
		    }
		    if (myNnumber != 0) {
			continue;
		    }
		}
	    }
	}
	System.out.println(max);
    }
}
